<script>
    
$(document).ready(function() {
	 
    $('#timepicker').datepicker({
        dateFormat: "yy-mm-dd",
        timeFormat: "HH:mm:ss"

    });
    $('#timepicker1').datepicker({
        dateFormat: "yy-mm-dd",
        timeFormat: "HH:mm:ss"

    });
   
  
  });

</script>
<?php $data= $this->arrParams;?>

<?php echo $this->search_form;?>
<?php 
	
	if(!isset($data['ProductID'])) 
	    $data['ProductID']=0; 
	if(!isset($data['time_search']))
		$data['time_search']=5;

?>
<script type="text/javascript">
var start = $("#timepicker1").val();
var end   = $("#timepicker").val();

var main_link = '/admin/user/total-user-login-chart-data/';
link = main_link+'ProductID/'+<?php echo $data['ProductID'];?>;
link = link+'/time_search/'+<?php echo $data['time_search'];?>;
if(start!= null){
	link = link+'/Starttime/'+start;
}
if(end!=null){
link = link+'/Endtime/'+end;
}
    $(document).ready(function(){
       $.getJSON(link, function(data) {
		// Create the chart
           Highcharts.setOptions({
          		global : {
          			useUTC : false
          		}
          	});
          	window.chart = new Highcharts.StockChart({
          		chart : {
          			renderTo : 'user',
          			events : {
          			}
          		},
          		rangeSelector: {
          			selected: 0
          		},
          		title : {
          			text : 'Biểu đồ số user login theo ngày'
          		},
          		yAxis: {
              		min : 0
          		},
				
          		exporting: {
          			enabled: false
          		},
          		
          		series : [{
          			name : 'Số người đăng nhập',
          			data : data
          		}]
          	});
	});
    });
</script>
<div id="user" style="height: 600px; width: 90%;float: right;padding-right: 2%;"></div>
<div style="clear: both;"></div>
